<!DOCTYPE html>
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org"
				xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">

<head>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>慈善图书首页</title>

  <link href="../css/bootstrap.css" rel="stylesheet"/>
  <link href="../css/all.css" rel="stylesheet"/>
  <link href="../css/index.css" rel="stylesheet"/>
  <link rel="stylesheet" href="../css/layui.css" media="all"/>
  <script src="http://at.alicdn.com/t/font_631371_i8gfdrhfd2muc8fr.js"></script>
  <script src="../js/jquery-2.0.3.min.js"></script>
  <script type="text/javascript">
  /*<![CDATA[*/
  $().ready(function(){
	  $.ajax({
			url: "/comment/getWishComment",
			data:{begin:1,length:4,jsonString:null},
			type: "GET",
			success: function (result){
				if(result!=""){
					var data = result.wishList;
					var html="";
	      		for(var obj in data){
	      			if(data[obj].isShow==0){
	      				data[obj].commentMsg="该愿望已被删除";
	      	    	}
	      			html+="<div class='comment-show-con clear-f' commentId="+data[obj].id+" wishId="+data[obj].wishId+">";
	      			html+="<div class='comment-show-con-img fl'><img src='"+data[obj].user.headImg+"' alt='用户头像'/></div>";
	      			html+="<div class='comment-show-con-list fl clear-f'>";
	      			html+="<p style='color:blue'>愿望图书："+data[obj].wishing.bookName+"&nbsp;作者："+data[obj].wishing.bookAuthor+"&nbsp;出版社："+data[obj].wishing.bookPress+"</p>";
	      			html+="<div class='pl-text clear-f'><a href='#' class='comment-size-name'>"+data[obj].user.nickname+" : </a>";
	      			html+="<span class='my-pl-con'>&nbsp;"+data[obj].commentMsg+"</span></div>";
	      			html+="<div class='date-dz clear-f'><span class='date-dz-left fl comment-time'>"+data[obj].addTime+"</span>";
	      			html+="<div class='date-dz-right fr comment-pl-block clear-f'>";
      				html+="<a href='javascript:;' class='removeBlock'>&nbsp;&nbsp;</a>";
	      			html+="<a href='javascript:;' class='date-dz-pl pl-hf hf-con-block fl'>评论(<i class='z-num'>"+data[obj].sonComments+"</i>)</a>";
	      			html+="<span class='fl date-dz-line'>|</span>";
	      			if(data[obj].isCurrentUserLike!=""&&data[obj].isCurrentUserLike!=null){
	      				html+="<a href='javascript:;' class='date-dz-z fl date-dz-z-click'>";
	      			}else{
	      				html+="<a href='javascript:;' class='date-dz-z fl'>";
	      			}
	      			html+="<i class='date-dz-z-click-red'></i>顶Ta (<i class='z-num'>"+data[obj].likes+"</i>)</a>";
	      			html+="</div></div><div class='hf-list-con'></div></div></div>";
	      		}
	      		$('#commentDiv').html(html);
				}
			}	
		});
  })
  
  function toUrl(){
	  location.href="../wish"
  }
  /*]]>*/
  </script>
</head>
<body>
  <div th:include="include :: header"></div>

  <div class="container clear-f container-top">
    <!-- 轮播图 Start -->
    <div class="swiper-div fl">
    	<iframe src="../page/recommended.html" height= "100%" width="100%"  frameborder="no" scrolling="No"  noresize="noresize" ></iframe>
    </div>
    <!-- 轮播图 End -->

    <div class="sort-div fr">
      <!-- 共享排行 Start -->
      <div class="share-sort">
      	<iframe src="../page/shareRank.html" height= "100%" width="100%"  frameborder="no" scrolling="No"  noresize="noresize" ></iframe>
      </div>
      <!-- 共享排行 End -->
      <!-- 借阅排行 Start -->
      <div class="borrow-sort">
        <iframe src="../page/borrowRank.html" height= "100%" width="100%"  frameborder="no" scrolling="No"  noresize="noresize" ></iframe>
      </div>
      <!-- 借阅排行 End -->
    </div>
  
    <!-- 慈善活动 Start -->
    <div class="portfolio fl" name="portfolio">
        <iframe src="../page/activity.html" height= "100%" width="100%"  frameborder="no" scrolling="No"  noresize="noresize" ></iframe>
    </div>
    <!-- 慈善活动 End -->
   
    <!-- 书愿展示 Start -->
    <div class="wish-div fl" name="portfolio">
        <div class="row">
          <p class="centered">书愿展示</p>
        </div>
        <div class="wish-list">
        
          <div class="comment-show" id="commentDiv" onclick="toUrl()">
          	  <div class="reviewArea clear-f">
              </div>
          	  <!-- 评论 -->
              <div class="comment-show-con clear-f">
                  <div class="comment-show-con-img fl">
                      <img src="../img/portfolio/folio01.jpg" alt=""/>
                  </div>
                  <div class="comment-show-con-list fl clear-f">
                      <div class="pl-text clear-f">
                          <a href="#" class="comment-size-name">许愿墙的自述 : </a>
                          <span class="my-pl-con">&nbsp;来啊 许个愿呀!</span>
                      </div>
                      <div class="date-dz clear-f">
                          <span class="date-dz-left fl comment-time">2018-1-1 00:00:00</span>
                      </div>
                      <div class="hf-list-con"></div>
                  </div>
              </div>
          <!-- 评论end -->    
          </div>
          
          
        </div>
    </div>
    <!-- 书愿展示 End -->
  </div>

  <div th:include="include :: footer"></div>
</body>
</html>
